package gwtI18nEditor.datamodel;

public class FileSection {

	private final Message message;
	private final String  literal;
	
	public FileSection(MessageFile parent, String identifier, MessageType type, String prefix, String infix, String suffix) {
		this.message = new Message(parent, identifier, type, prefix, infix, suffix);
		this.literal = null;
	}
	
	public FileSection(Message message) {
		this.message = message;
		this.literal = null;
	}
	
	public FileSection(String literal) {
		this.message = null;
		this.literal = literal;
	}
	
	public boolean isMessage() {
		return message!=null;
	}
	
	public Message getMessage() {
		return message;
	}

	public String getLiteral() {
		return (literal==null) ? "" : literal;
	}
}
